'use strict';
/* 用户主界面 */

var React = require('react-native');

var {
	StyleSheet,
	Text,
	TextInput,
	View,
	ScrollView,
	TouchableOpacity,
	ToastAndroid,
	Image
} = React;

module.exports = React.createClass({

	propTypes: {
		navigator: React.PropTypes.object.isRequired
	},

	getInitialState: function() {
		return {

		}
	},

	render: function() {

		var NeedLoginView = this.renderNeedLoginView();

		return (
			<View style={styles.container}>
				{NeedLoginView}
			</View>
		)
	},

	renderNeedLoginView: function() {
		return (
			<TouchableOpacity style={LoginViewStyle.container} onPress={this.toLoginView}>
				<View>
					<Image
			        	style={LoginViewStyle.photo}
			        	source={{uri:'http://tp4.sinaimg.cn/5538965519/180/0/1'}}/>
					<View style={LoginViewStyle.loginLink}>
					    <Text style={LoginViewStyle.loginLinkText}>请点击登录</Text>
					</View>
				</View>
			</TouchableOpacity>
		)
	},

	toLoginView: function() {
		this.props.navigator.push({
			name: 'LoginView'
		});
	},
})

var styles = StyleSheet.create({
	container: {
		flex: 1
	},


});

var LoginViewStyle = StyleSheet.create({
	container: {
		padding: 15,
		backgroundColor: '#6495ED',
		alignItems: 'center',
	},
	photo: {
		width: 90,
		height: 90,
		borderRadius: 45,
	},
	loginLink: {
		marginTop: 25,
	},
	loginLinkText: {
		color: '#FFF',
		fontSize: 20,
	},
})